package com.cybertron.ironhide.manage.action;

import com.cybertron.ironhide.manage.common.base.BaseAction;
import com.cybertron.ironhide.manage.domain.SpiderModel;
import com.cybertron.ironhide.manage.util.SpiderCheckUtil;

public class SpiderCheckAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6163205471946947230L;

	private SpiderModel model;

	public String list() {
		model = SpiderCheckUtil.getModel();
		return LIST;
	}

	public String add() {
		return ADD;
	}

	public String doAdd() throws Exception {
		SpiderCheckUtil.check(model);
		return ajaxSuccess("目标URL数：" + model.getTargetUrlCount() + "</br>"
				+ "下一页URL数：" + model.getNextUrlCount(), "spider-check-list",
				null, CLOSE_CURRENT);
	}

	public SpiderModel getModel() {
		return model;
	}

	public void setModel(SpiderModel model) {
		this.model = model;
	}

}
